package com.delianna.bwt.helpers;

import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Delio Castillo (jangeador@gmail.com)
 * 
 */
public class TimeHelper {

	public static String adjustTimeToLocalTimeSDF(String dateValue) {

		// Parse string date and set the time zone
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-M-d h:m:s z");
		ParsePosition position = new ParsePosition(0);
		Date originalDate = formatter.parse(dateValue, position);

		// create a new format and pass the originalDate
		SimpleDateFormat outFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm");
		// outFormat.setTimeZone(TimeZone.getTimeZone(Time.getCurrentTimezone()));
		String retVal = outFormat.format(originalDate);

		return retVal;
	}
}